﻿using System;
using System.Collections.Generic;
using System.Text;
using ArlesInterfaces.Editor;
using ArlesInterfaces.Render;
using Arles.src.utils;
using Arles.src.view;
using Arles.src.model;

namespace Arles.src.controller
{
    public class Editor : IEditor
    {
        //Static Members
        static Editor handle;

        //Private Members
        IInvoker invoker;
        IRender render;
        IScene scene;
        IMainForm mainForm;

        //Public Members

        #region Properties
        public static IEditor Instance
        {
            get
            {
                if (handle == null)
                    handle = new Editor();

                return handle;
            }
        }

        public IInvoker Invoker
        {
            get { return invoker; }
            set { invoker = value; }
        }

        public IRender Render
        {
            get { return render; }
            set { render = value; }
        }

        public IMainForm MainForm
        {
            get { return mainForm; }
            set { mainForm = value; }
        }

        public IScene Scene
        {
            get { return scene; }
        }

        #endregion

        private Editor()
        {
        }

        public void Initialize(IHistory history)
        {
            Invoker = new Invoker(history);
            scene = new Scene();
            
            LogFactory.Instance.Write("Welcome to Arles");

        }

        //TODO
    }
}
